@@ -164,6 +164,7 @@ h4 {
|
||
| 164 | 164 |
color: #000000; |
| 165 | 165 |
line-height: 44px; |
| 166 | 166 |
margin-top: 0px; |
| 167 |
+ height: 88px; |
|
| 167 | 168 |
} |
| 168 | 169 |
|
| 169 | 170 |
.thumbnail h2 a, .box h2 a {
|
@@ -200,10 +200,14 @@ |
||
| 200 | 200 |
} |
| 201 | 201 |
|
| 202 | 202 |
.thumbnail-task.single {
|
| 203 |
- height: 156px; |
|
| 203 |
+ height: 148px; |
|
| 204 | 204 |
overflow-y: hidden; |
| 205 | 205 |
} |
| 206 | 206 |
|
| 207 |
+.thumbnail-task.single p:nth-child(2){
|
|
| 208 |
+ margin-top: 10px; |
|
| 209 |
+} |
|
| 210 |
+ |
|
| 207 | 211 |
.thumbnail-task.single p:nth-child(2) {
|
| 208 | 212 |
font-family: Helvetica-LightOblique; |
| 209 | 213 |
font-size: 14px; |
@@ -307,6 +311,7 @@ |
||
| 307 | 311 |
font-size: 14px; |
| 308 | 312 |
color: #1D1D26; |
| 309 | 313 |
line-height: 17px; |
| 314 |
+ margin-top: 15px; |
|
| 310 | 315 |
} |
| 311 | 316 |
|
| 312 | 317 |
.open-agent-role .btn-spacer {
|
@@ -330,6 +335,19 @@ |
||
| 330 | 335 |
font-size: 14px; |
| 331 | 336 |
color: #1D1D26; |
| 332 | 337 |
line-height: 19px; |
| 338 |
+ width: 200px; |
|
| 339 |
+ padding-top: 8px; |
|
| 340 |
+ margin-bottom: 10px; |
|
| 341 |
+} |
|
| 342 |
+ |
|
| 343 |
+.agent-stats i {
|
|
| 344 |
+ font-size: 36px; |
|
| 345 |
+ padding-right: 8px; |
|
| 346 |
+} |
|
| 347 |
+ |
|
| 348 |
+.agent-stats i:nth-child(1) {
|
|
| 349 |
+ padding-left: 3px; |
|
| 350 |
+ padding-right: 5px; |
|
| 333 | 351 |
} |
| 334 | 352 |
|
| 335 | 353 |
.agent-points {
|
@@ -3,6 +3,7 @@ class AgentsController < ApplicationController |
||
| 3 | 3 |
def dashboard |
| 4 | 4 |
if user_signed_in? |
| 5 | 5 |
@agent_missions = current_user.mission_agents |
| 6 |
+ @directing_missions = Mission.find_all_by_owner_id(current_user.id) |
|
| 6 | 7 |
else |
| 7 | 8 |
redirect_to(new_user_session_path, alert: (t 'agent.not_logged_in')) |
| 8 | 9 |
end |
@@ -21,4 +21,14 @@ class MissionAgent < ActiveRecord::Base |
||
| 21 | 21 |
end |
| 22 | 22 |
end |
| 23 | 23 |
|
| 24 |
+ def incompleted_step_count |
|
| 25 |
+ steps = 0 |
|
| 26 |
+ self.agent_steps.each do |step| |
|
| 27 |
+ if step.completed |
|
| 28 |
+ steps = steps + 1 |
|
| 29 |
+ end |
|
| 30 |
+ end |
|
| 31 |
+ return steps |
|
| 32 |
+ end |
|
| 33 |
+ |
|
| 24 | 34 |
end |
@@ -34,4 +34,34 @@ class User < ActiveRecord::Base |
||
| 34 | 34 |
@analytics.track_user_registration(self) |
| 35 | 35 |
end |
| 36 | 36 |
|
| 37 |
+ def incomplete_step_count |
|
| 38 |
+ total = 0 |
|
| 39 |
+ self.mission_agents.each do |agent| |
|
| 40 |
+ total = total + agent.incompleted_step_count |
|
| 41 |
+ end |
|
| 42 |
+ return total |
|
| 43 |
+ end |
|
| 44 |
+ |
|
| 45 |
+ def mission_count |
|
| 46 |
+ return self.mission_agents.count |
|
| 47 |
+ end |
|
| 48 |
+ |
|
| 49 |
+ def completed_missions_count |
|
| 50 |
+ total = 0 |
|
| 51 |
+ self.mission_agents.each do |agent| |
|
| 52 |
+ if agent.mission.status == 3 |
|
| 53 |
+ total = total + 1 |
|
| 54 |
+ end |
|
| 55 |
+ end |
|
| 56 |
+ return total |
|
| 57 |
+ end |
|
| 58 |
+ |
|
| 59 |
+ def directing_missions_count |
|
| 60 |
+ return Mission.find_all_by_owner_id(self.id).count |
|
| 61 |
+ end |
|
| 62 |
+ |
|
| 63 |
+ def directed_missions_count |
|
| 64 |
+ return Mission.where(owner_id: self.id).where(status: 3).count |
|
| 65 |
+ end |
|
| 66 |
+ |
|
| 37 | 67 |
end |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 |
<%= content_tag(:div, class: 'dashboard-stats') do %> |
| 15 | 15 |
<%= content_tag(:p) do %> |
| 16 | 16 |
<%= content_tag(:i, '', class: 'icon-mission') %> |
| 17 |
- <%= content_tag(:span, '6') %> |
|
| 17 |
+ <%= content_tag(:span, @agent_missions.count) %> |
|
| 18 | 18 |
<% end %> |
| 19 | 19 |
<%= content_tag(:p, (t 'mission.missions')) %> |
| 20 | 20 |
<% end %> |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 |
<%= content_tag(:div, class: 'dashboard-stats') do %> |
| 23 | 23 |
<%= content_tag(:p) do %> |
| 24 | 24 |
<%= content_tag(:i, '', class: 'icon-radar') %> |
| 25 |
- <%= content_tag(:span, '2') %> |
|
| 25 |
+ <%= content_tag(:span, current_user.directing_missions_count) %> |
|
| 26 | 26 |
<% end %> |
| 27 | 27 |
<%= content_tag(:p, (t 'mission.directing_missions')) %> |
| 28 | 28 |
<% end %> |
@@ -30,12 +30,12 @@ |
||
| 30 | 30 |
<%= content_tag(:div, class: 'dashboard-stats') do %> |
| 31 | 31 |
<%= content_tag(:p) do %> |
| 32 | 32 |
<%= content_tag(:i, '', class: 'icon-task') %> |
| 33 |
- <%= content_tag(:span, '21') %> |
|
| 33 |
+ <%= content_tag(:span, current_user.incomplete_step_count) %> |
|
| 34 | 34 |
<% end %> |
| 35 | 35 |
<%= content_tag(:p, (t 'agent.tasks')) %> |
| 36 | 36 |
<% end %> |
| 37 | 37 |
<% # Messsages Count %> |
| 38 |
- <%= content_tag(:div, class: 'dashboard-stats') do %> |
|
| 38 |
+ <% content_tag(:div, class: 'dashboard-stats') do %> |
|
| 39 | 39 |
<%= content_tag(:p) do %> |
| 40 | 40 |
<%= content_tag(:i, '', class: 'icon-chat') %> |
| 41 | 41 |
<%= content_tag(:span, '48') %> |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 |
<%= content_tag(:p, (t 'agent.messages')) %> |
| 44 | 44 |
<% end %> |
| 45 | 45 |
<% # Points %> |
| 46 |
- <%= content_tag(:div, class: 'dashboard-stats') do %> |
|
| 46 |
+ <% content_tag(:div, class: 'dashboard-stats') do %> |
|
| 47 | 47 |
<%= content_tag(:p) do %> |
| 48 | 48 |
<%= content_tag(:span, '150K') %> |
| 49 | 49 |
<% end %> |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 |
<% end %> |
| 52 | 52 |
<%= bootstrap_flash %> |
| 53 | 53 |
<% end %> |
| 54 |
- <%= content_tag(:div, class: 'span4 trust-stat') do %> |
|
| 54 |
+ <% content_tag(:div, class: 'span4 trust-stat') do %> |
|
| 55 | 55 |
<div class="progress-bar"> |
| 56 | 56 |
<div class="progress progress-striped"> |
| 57 | 57 |
<div class="bar bar-success" style="width: 95%;"></div> |
@@ -94,34 +94,15 @@ |
||
| 94 | 94 |
<%= content_tag(:h4, (t 'agent.next_steps')+':', class: 'dashboard-role') %> |
| 95 | 95 |
|
| 96 | 96 |
<% end %> |
| 97 |
+ |
|
| 97 | 98 |
<% # Steps %> |
| 98 |
- <% step_count = 0 %> |
|
| 99 |
- <% has_shown_more_tasks = false %> |
|
| 100 |
- <% agent.agent_steps.order('step ASC').each do |step| %>
|
|
| 101 |
- <% step_count = step_count + 1 %> |
|
| 102 |
- <% if step_count <= 2 || agent.agent_steps.count <= 3 %> |
|
| 103 |
- <%= content_tag(:div, class: 'thumbnail-task') do %> |
|
| 104 |
- <%= content_tag(:p) do %> |
|
| 105 |
- <%= content_tag(:span, step.step, class: 'task-number') %> |
|
| 106 |
- <%= content_tag(:span, step.title, class: 'task-text') %> |
|
| 107 |
- <%= content_tag(:span, step.icons.html_safe, class: 'task-icon') %> |
|
| 108 |
- <% end %> |
|
| 109 |
- <% end %> |
|
| 110 |
- <% else %> |
|
| 111 |
- <% if has_shown_more_tasks == false %> |
|
| 112 |
- <% has_shown_more_tasks = true %> |
|
| 113 |
- <%= content_tag(:div, class: 'thumbnail-task') do %> |
|
| 114 |
- <%= content_tag(:p, class: 'task-show-all') do %> |
|
| 115 |
- <%= content_tag(:span, ('+ ' + (agent.agent_steps.count - step_count).to_s + ' ' + (t 'mission.steps')).html_safe) %>
|
|
| 116 |
- <% end %> |
|
| 117 |
- <% end %> |
|
| 118 |
- <% end %> |
|
| 119 |
- <% end %> |
|
| 120 |
- <% end %> |
|
| 99 |
+ <%= render :partial => 'missions/step_quick_list', locals: {agent: agent} %>
|
|
| 100 |
+ |
|
| 121 | 101 |
<% # Progress bar %> |
| 122 | 102 |
<%= content_tag(:div, class: 'thumbnail-content mission-agent-percentage') do %> |
| 123 | 103 |
<%= render :partial => 'missions/mission_percentage_bar', locals: { mission: agent.mission, size: '' } %>
|
| 124 | 104 |
<% end %> |
| 105 |
+ |
|
| 125 | 106 |
<%= content_tag(:div, class: 'thumbnail-content mission-status-timer') do%> |
| 126 | 107 |
<%= content_tag(:div) do %> |
| 127 | 108 |
<%= mission_time_left(agent.mission) %> |
@@ -1 +1,7 @@ |
||
| 1 |
-<a class="nav-responsive-link btn-logo" href="/"><%= image_tag "logo_avalanche_mobile.png", class: 'brand', style: 'height: 36px;' %></a> |
|
| 1 |
+<a class="nav-responsive-link btn-logo" href="/"> |
|
| 2 |
+ <% if user_signed_in? %> |
|
| 3 |
+ <%= image_tag "logo_avalanche_mobile.png", class: 'brand', style: 'height: 36px;' %> |
|
| 4 |
+ <% else %> |
|
| 5 |
+ <%= image_tag "logo_avalanche.png", class: 'brand', style: 'height: 36px;' %> |
|
| 6 |
+ <% end %> |
|
| 7 |
+</a> |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 |
<%= content_tag(:span, step.title, class: 'task-text') %> |
| 30 | 30 |
<%= content_tag(:span, step.icons.html_safe, class: 'task-icon pull-right') %> |
| 31 | 31 |
<% end %> |
| 32 |
- <%= content_tag(:p, strip_tags(step.description).truncate(330, separator: '...'))%> |
|
| 32 |
+ <%= content_tag(:p, strip_tags(step.description).truncate(270, separator: '...'))%> |
|
| 33 | 33 |
<% end %> |
| 34 | 34 |
<% end %> |
| 35 | 35 |
|
@@ -30,10 +30,18 @@ |
||
| 30 | 30 |
<%= content_tag(:div, class: 'mission-agent-status assigned-agent-role') do %> |
| 31 | 31 |
<%= content_tag(:h4, (t 'mission.agent')+':') %> |
| 32 | 32 |
<%= content_tag(:div, class: 'pull-left') do %> |
| 33 |
- <%= content_tag(:p, @agent.user.full_name) %> |
|
| 34 |
- <%= content_tag(:p, ('<i class="icon-mission"></i><span> ' + 5.to_s + ' ' + (t 'agent.missions_acomplished')).html_safe, class: 'agent-stats') %>
|
|
| 35 |
- <%= content_tag(:p, ('<i class="icon-radar"></i><span> ' + 2.to_s + ' ' + (t 'agent.missions_directed')).html_safe, class: 'agent-stats') %>
|
|
| 36 |
- <%= content_tag(:p, ('<span class="agent-points">' + 19.to_s + 'K</span> ' + (t 'agent.points')).html_safe, class: 'agent-stats') %>
|
|
| 33 |
+ <%= content_tag(:div, class: '') do %> |
|
| 34 |
+ <%= content_tag(:p, @agent.user.full_name) %> |
|
| 35 |
+ <%= content_tag(:span, '<i class="icon-mission"></i>'.html_safe, class: 'pull-left agent-stats')%> |
|
| 36 |
+ <% end %> |
|
| 37 |
+ <%= content_tag(:div, class: '') do %> |
|
| 38 |
+ <%= content_tag(:p, (@agent.user.completed_missions_count.to_s + ' ' + (t 'agent.missions_acomplished')).html_safe, class: 'agent-stats') %> |
|
| 39 |
+ <%= content_tag(:span, '<i class="icon-radar"></i> '.html_safe, class: 'pull-left agent-stats')%> |
|
| 40 |
+ <% end %> |
|
| 41 |
+ |
|
| 42 |
+ <%= content_tag(:p, (@agent.user.directed_missions_count.to_s + ' ' + (t 'agent.missions_directed')).html_safe, class: 'agent-stats') %> |
|
| 43 |
+ |
|
| 44 |
+ <% content_tag(:p, ('<span class="agent-points">' + 19.to_s + 'K</span> ' + (t 'agent.points')).html_safe, class: 'agent-stats') %>
|
|
| 37 | 45 |
<% end %> |
| 38 | 46 |
<%= content_tag(:div, class: 'pull-right') do %> |
| 39 | 47 |
<% if @agent.user.avatar.file != nil %> |